#!/bin/sh
#
# vpdaemon	VP Remote daemon
#		
#

dam=vpremoted

vpd=/usr/sbin/$dam

. /etc/rc.d/init.d/functions

NAME='VP IR Deaemon'

start()
{
	if [ "`pidof $dam`" == "" ]; then
		msg_starting "$NAME"
		busy
		if [ -x $vpd ]; then
			$vpd AS_DAEMON
			ok 
  		else
   			 show "!!!$vpd not found!!!"; fail
 		 fi	
		
	else
		msg_already_running "$NAME"
	fi



}

stop()
{
	msg_stopping "$NAME"
	busy
	if [ "`pidof $dam`" == "" ]; then
		echo
		msg_not_running "$NAME"
	else
		killall -w $dam
	fi
	ok
}

case "$1" in
  start)
	# Start driver.
# 	start
	;;
  stop)
	# Stop daemons.
# 	stop
	;;
  restart|force-reload)
	$0 stop
	$0 start
	exit $?
	;;
  status)
	# TODO
	;;
  *)
	msg_usage "$0 {start|stop|restart|status}"
	exit 3
esac

exit 0
